Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…actually points to globalThis
…rror notification
…the magic number when checking upload sizes
…load_size (based on MaxRequestBodySize)
| def cleanup_site_settings | ||
| to_remove = [] | ||
|
|
||
| $site_settings_map.each do |community_id, names| | ||
| stale_settings = SiteSetting.unscoped | ||
| .where(community_id: community_id) | ||
| .where.not(name: names) | ||
| to_remove.push(*stale_settings) | ||
| end | ||
|
|
||
| return unless to_remove.any? | ||
|
|
||
| ActiveRecord::Base.transaction do | ||
| to_remove.each(&:destroy!) | ||
| end | ||
|
|
||
| puts "#{SiteSetting.model_name}: removed #{to_remove.size}" | ||
| end |
There was a problem hiding this comment.
After this PR is merged, we'll start automatically removing SiteSettings that are no longer present in seeds. My hope is that it'll evolve into a proper cleanup step in the future and then into a full solution for dynamically changing seeds.
There was a problem hiding this comment.
Question: if a setting is no longer in seeds but is in the DB, then code that still checks for that setting would continue to work in existing deployments and fail in new ones. How do we make sure that there's no referring code before removing, and especially auto-removing, a setting? I love having cleanup but do want to make sure we only clean up truly unused stuff.
closes #1968 (the label is now configurable via locale strings):
closes #1971:
closes #1975 - comment threads now use the
priority_ordercommon scope regardless of whether they are initially loaded or expanded via the "show more" button (note that we still order byupdated_atand notlast_activity_at- we should switch to the latter when we can).closes #1970:
closes #1965 (see below);
closes #1966 (see below);
closes #1884 (we now simply use Moment.js to format timestamps - note the new format and preserved relative time):
closes #1977 (also exposes

MaxUploadSizeto client-side code asQPixel.MAX_UPLOAD_SIZE):closes #1969 (with existing threads and no threads respectively):
closes #1671 (new site setting:

MaxRequestBodySize):